Skip to content

feat(cinder): add project and volume-type quota metrics - #4

Open
davidhulick wants to merge 3 commits into
contrib/octavia-quotas-2b3from
contrib/cinder-quotas-2b4
Open

davidhulick wants to merge 3 commits into
contrib/octavia-quotas-2b3from
contrib/cinder-quotas-2b4

Conversation

@davidhulick

@davidhulick davidhulick commented Nov 19, 2026 •

Copy link
Copy Markdown

Summary

Add Cinder project and volume-type quota monitoring using persisted limits, usage, and reservations.

This includes:

  • Project quota limits, usage, and reservations.
  • Volume-type quota accounting.
  • Configured defaults and default-class precedence.
  • Separate quota collection health.
  • Bounded SQL queries and sanitized error diagnostics.
  • Capacity metrics expressed in bytes.
  • Extended unit and integration test coverage.

Quota accounting

Quota limits and usage are read independently from Cinder's persisted accounting tables rather than reconstructed from volume inventory.

The implementation preserves:

  • Explicit project overrides and default-class precedence.
  • NULL limit inheritance and unlimited (-1) limits.
  • Signed usage and reservation values.
  • Independent volume-type quota defaults.
  • Usage-only and idle projects.
  • Isolation of malformed or duplicate accounting records.

openstack_cinder_quota_up reports collector health separately from existing Cinder inventory health.

Some ambiguous or invalid records may have their dependent metric series omitted without failing the entire collection. Consequently, quota_up=1 does not guarantee that every possible quota series was emitted.

Breaking metric changes

Six existing Cinder capacity metrics are renamed and converted from GiB to bytes:

  • openstack_cinder_limits_volume_max_gb → openstack_cinder_limits_volume_max_bytes
  • openstack_cinder_limits_volume_used_gb → openstack_cinder_limits_volume_used_bytes
  • openstack_cinder_limits_backup_max_gb → openstack_cinder_limits_backup_max_bytes
  • openstack_cinder_limits_backup_used_gb → openstack_cinder_limits_backup_used_bytes
  • openstack_cinder_volume_type_quota_gigabytes → openstack_cinder_volume_type_quota_bytes
  • openstack_cinder_volume_gb → openstack_cinder_volume_bytes

Five additional capacity families are introduced directly with byte-based names.

The existing quota capacity families also gain the domain_id label. Consumers must update metric names, label selectors, thresholds, and any existing GiB-to-byte conversions.

Unlimited limits retain -1; signed usage, reservations, and inventory values are converted normally.

Contribution relationship

Follow-up contribution — stacked on [Octavia quota monitoring (#3)](#3).

This PR reuses the shared quota configuration introduced by the Octavia contribution. It is otherwise an independent Cinder feature and does not depend on the Manila or Neutron exporter contributions.

Required openstackdb contributions:

The separate [Cinder inventory deduplication fix (exporter #1)](#1) is not part of this staging diff. Both changes must be preserved when integrating Cinder upstream, including updating the inventory regression tests for byte-based capacity values.

This PR currently targets the Octavia branch to keep its review diff limited to Cinder changes. It will be rebased onto upstream main after the shared prerequisite is merged.

Read persisted project limits, usage, defaults and active volume types independently. Preserve signed accounting and isolate ambiguous resources with sanitized diagnostics. Extend shared configuration and register one quota collector while retaining the limits adapter.

Expose Cinder capacities in bytes and add domain identity to quota capacities. Keep inventory attachment-row behavior for the separate deduplication fix.

Requires the public openstackdb Cinder and Octavia quota APIs. Keep the canonical library requirement and validate through an external workspace. Short and race tests, vet, build and module verification pass; native database validation is blocked by unavailable Docker.

Signed-off-by: David Hulick <dave.hulick@gmail.com>
Extend the existing Cinder fixture with nullable overrides, default-class limits, signed accounting, deleted rows, typed resources and idle and usage-only projects. Check all sixteen quota families, exact labels and gauge values, inventory bytes and retired capacity names.

Preserve the existing service fixtures, Octavia quota assertions and Nova task-state check. Integration-tag vet passes; native MariaDB execution is blocked because Docker is unavailable.

Signed-off-by: David Hulick <dave.hulick@gmail.com>
@davidhulick
davidhulick force-pushed the contrib/cinder-quotas-2b4 branch from 0dc043f to 8e3d70a Compare November 19, 2026 21:00
@davidhulick davidhulick changed the title Contrib/cinder quotas 2b4 feat(cinder): add project and volume-type quota metrics Nov 20, 2026
The staged openstackdb Cinder quota rework removed the QuotaRepository
wrapper and renamed several query methods, leaving the exporter unable
to compile against the updated API.

Update the Cinder quota collector to use the generated Queries API
directly and adjust the associated test expectations.

Preserve existing quota accounting, default precedence, error handling,
and Prometheus metric behavior.

Verified against the combined staged Cinder and Octavia openstackdb
APIs with successful build, vet, and targeted unit tests.

Signed-off-by: David Hulick <dave.hulick@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant